﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;




namespace  YodaMaster.Models
{
    public class compare_dates
    {
        public static int compare(DateTime t1_start, DateTime t1_end, DateTime t2_start, DateTime t2_end)
        {
            int result1 = DateTime.Compare(t1_end, t2_start);
            int result2 = DateTime.Compare(t1_end, t2_end);
            int result3 = DateTime.Compare(t1_start, t2_start);
            int result4 = DateTime.Compare(t1_start, t2_end);

            int result5 = DateTime.Compare(t2_end, t1_start);
            int result6 = DateTime.Compare(t2_end, t1_end);
            int result7 = DateTime.Compare(t2_start, t1_start);
            int result8 = DateTime.Compare(t2_start, t1_end);


            if (result1 > 0 && result2 <= 0)
                return 0;
            if (result3 >= 0 && result4 < 0)
                return 0;
            if (result5 > 0 && result6 <= 0)
                return 0;
            if (result7 >= 0 && result8 < 0)
                return 0;
            return 1;

        }
    }
}